import { Component, OnInit } from '@angular/core';
import { CommonService } from '../../service/common.service'
import { StorageService } from '../../service/storage.service'
import { ActivatedRoute, Router } from '@angular/router';

@Component({
  selector: 'app-noticedetail',
  templateUrl: './noticedetail.page.html',
  styleUrls: ['./noticedetail.page.scss'],
})
export class NoticedetailPage implements OnInit {

  public noticeDetail:any;
  public userInfo:any;
  public parmes:any;
  
  constructor(private common:CommonService,public activatedRoute: ActivatedRoute,private storage:StorageService) { }

  ngOnInit() {
    //接受路由传值过来的图片路径
    this.activatedRoute.queryParams.subscribe((data: any) => {
      this.parmes = data
    })
    this.userInfo = this.common.getInfo()
    this.notice()
  }

  // 通知消息，滚动播出
  notice(){  

    var api = '/tbr/siteNotice/getNoticeDetails?'+'userId='+this.userInfo.userId+'&noticeId='+this.parmes.noticeId
    this.common.get(api).then((res:any)=>{
      // console.log(res)
      if(res.code == 200){
        this.noticeDetail = res.data
      }
    })
  }

}
